import request from "@/utils/request.js"

/**
 * 分页查询用户答题记录
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const queryUserAnswerPage = (data) => {
  return request.post("/admin/answer/page", data)
}

/**
 * 通过 id 获取用户答题记录
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const getUserAnswerById = (data) => {
  return request.get("/admin/answer/" + data)
}

/**
 * 删除用户答题记录
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const deleteUserAnswer = (data) => {
  return request.delete("/admin/answer", { data })
}

/**
 * 导出用户答题记录信息表格
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const exportUserAnswer = (data) => {
  return request.post("/admin/answer/export", data, { responseType: 'blob' })
}
